package com.zuthub.system.service.impl;

import java.util.List;
import com.zuthub.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zuthub.system.mapper.SysSponsorshipMapper;
import com.zuthub.system.domain.SysSponsorship;
import com.zuthub.system.service.ISysSponsorshipService;

/**
 * 赞助管理Service业务层处理
 * 
 * @author zuthub
 * @date 2021-04-02
 */
@Service
public class SysSponsorshipServiceImpl implements ISysSponsorshipService 
{
    @Autowired
    private SysSponsorshipMapper sysSponsorshipMapper;

    /**
     * 查询赞助管理
     * 
     * @param sponsorshipId 赞助管理ID
     * @return 赞助管理
     */
    @Override
    public SysSponsorship selectSysSponsorshipById(Long sponsorshipId)
    {
        return sysSponsorshipMapper.selectSysSponsorshipById(sponsorshipId);
    }

    /**
     * 查询赞助管理列表
     * 
     * @param sysSponsorship 赞助管理
     * @return 赞助管理
     */
    @Override
    public List<SysSponsorship> selectSysSponsorshipList(SysSponsorship sysSponsorship)
    {
        return sysSponsorshipMapper.selectSysSponsorshipList(sysSponsorship);
    }

    /**
     * 新增赞助管理
     * 
     * @param sysSponsorship 赞助管理
     * @return 结果
     */
    @Override
    public int insertSysSponsorship(SysSponsorship sysSponsorship)
    {
        sysSponsorship.setCreateTime(DateUtils.getNowDate());
        return sysSponsorshipMapper.insertSysSponsorship(sysSponsorship);
    }

    /**
     * 修改赞助管理
     * 
     * @param sysSponsorship 赞助管理
     * @return 结果
     */
    @Override
    public int updateSysSponsorship(SysSponsorship sysSponsorship)
    {
        sysSponsorship.setUpdateTime(DateUtils.getNowDate());
        return sysSponsorshipMapper.updateSysSponsorship(sysSponsorship);
    }

    /**
     * 批量删除赞助管理
     * 
     * @param sponsorshipIds 需要删除的赞助管理ID
     * @return 结果
     */
    @Override
    public int deleteSysSponsorshipByIds(Long[] sponsorshipIds)
    {
        return sysSponsorshipMapper.deleteSysSponsorshipByIds(sponsorshipIds);
    }

    /**
     * 删除赞助管理信息
     * 
     * @param sponsorshipId 赞助管理ID
     * @return 结果
     */
    @Override
    public int deleteSysSponsorshipById(Long sponsorshipId)
    {
        return sysSponsorshipMapper.deleteSysSponsorshipById(sponsorshipId);
    }
}
